#include <iostream>
#include <set>
#include <vector>
#include <algorithm>

namespace xsz
{
    template <class T>
    class set_sort
    {
    private:
        std::multiset<T> s;

    public:
        set_sort(std::vector<T> v)
        {
            for (auto e : v)
            {
                s.insert(e);
            }
        }
        std::vector<T> order_result()
        {
            typename std::multiset<T>::iterator it = s.begin();
            std::vector<T> v;
            while (it != s.end())
            {
                v.push_back(*it);
                ++it;
            }
            return v;
        }
        std::vector<T> desc_result()
        {
            typename std::multiset<T>::reverse_iterator it = s.rbegin();
            std::vector<T> v;
            while (it != s.rend())
            {
                v.push_back(*it);
                ++it;
            }
            return v;
        }
    };
}